package com.zf.yichat.mapper;

import com.zf.yichat.base.FsMapper;
import com.zf.yichat.dto.BalanceDetailCountDto;
import com.zf.yichat.dto.SaleChartItem;
import com.zf.yichat.model.UserBalanceDetail;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface UserBalanceDetailMapper extends FsMapper<UserBalanceDetail> {
    BigDecimal sumTotalByType(@Param("userId") Long userId, @Param("type") int val, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<BalanceDetailCountDto> sumTotalGroupByType(@Param("startId") Long startId, @Param("endId") Long endId);

    List<SaleChartItem> selectChartList();

    Long selectChartOrderNum(@Param("money") BigDecimal money);

    /**
     * 查询用户最后一次的余额
     * @param userId
     * @return
     */
    String queryDetailsLastTime(@Param("userId") Long userId);

    /**
     * 查询用户开通会员记录
     * @param userId
     * @return
     */
    List<UserBalanceDetail> queryUserActivateRecord(@Param("userId") Long userId);
}